home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / TSMTE.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  3.4 KB  |  131 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        TSMTE.h
  3.  
  4.      Contains:    Text Services Managerfor TextEdit Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    ©1991-1998 Apple Technology, Inc. All rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __TSMTE__
  18. #define __TSMTE__
  19.  
  20. #ifndef __TEXTEDIT__
  21. #include <TextEdit.h>
  22. #endif
  23. #ifndef __DIALOGS__
  24. #include <Dialogs.h>
  25. #endif
  26. #ifndef __APPLEEVENTS__
  27. #include <AppleEvents.h>
  28. #endif
  29. #ifndef __TEXTSERVICES__
  30. #include <TextServices.h>
  31. #endif
  32. /* #include <Gestalt.i>*/
  33.  
  34.  
  35.  
  36.  
  37. #if PRAGMA_ONCE
  38. #pragma once
  39. #endif
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. #if PRAGMA_IMPORT
  46. #pragma import on
  47. #endif
  48.  
  49. #if PRAGMA_STRUCT_ALIGN
  50.     #pragma options align=mac68k
  51. #elif PRAGMA_STRUCT_PACKPUSH
  52.     #pragma pack(push, 2)
  53. #elif PRAGMA_STRUCT_PACK
  54.     #pragma pack(2)
  55. #endif
  56.  
  57. /* signature, interface types*/
  58.  
  59. enum {
  60.     kTSMTESignature                = FOUR_CHAR_CODE('tmTE'),
  61.     kTSMTEInterfaceType            = FOUR_CHAR_CODE('tmTE'),
  62.     kTSMTEDialog                = FOUR_CHAR_CODE('tmDI')
  63. };
  64.  
  65.  
  66. /* update flag for TSMTERec*/
  67.  
  68. enum {
  69.     kTSMTEAutoScroll            = 1
  70. };
  71.  
  72.  
  73. /* callback procedure definitions*/
  74.  
  75. typedef CALLBACK_API( void , TSMTEPreUpdateProcPtr )(TEHandle textH, long refCon);
  76. typedef CALLBACK_API( void , TSMTEPostUpdateProcPtr )(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
  77. typedef STACK_UPP_TYPE(TSMTEPreUpdateProcPtr)                     TSMTEPreUpdateUPP;
  78. typedef STACK_UPP_TYPE(TSMTEPostUpdateProcPtr)                     TSMTEPostUpdateUPP;
  79.  
  80.  
  81. /* data types*/
  82.  
  83. struct TSMTERec {
  84.     TEHandle                         textH;
  85.     TSMTEPreUpdateUPP                 preUpdateProc;
  86.     TSMTEPostUpdateUPP                 postUpdateProc;
  87.     long                             updateFlag;
  88.     long                             refCon;
  89. };
  90. typedef struct TSMTERec                    TSMTERec;
  91. typedef TSMTERec *                        TSMTERecPtr;
  92. typedef TSMTERecPtr *                    TSMTERecHandle;
  93.  
  94. struct TSMDialogRecord {
  95.     DialogRecord                     fDialog;
  96.     TSMDocumentID                     fDocID;
  97.     TSMTERecHandle                     fTSMTERecH;
  98.     long                             fTSMTERsvd[3];                /* reserved*/
  99. };
  100. typedef struct TSMDialogRecord            TSMDialogRecord;
  101.  
  102. typedef TSMDialogRecord *                TSMDialogPtr;
  103. typedef TSMDialogPtr                     TSMDialogPeek;
  104. enum { uppTSMTEPreUpdateProcInfo = 0x000003C0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes) */
  105. enum { uppTSMTEPostUpdateProcInfo = 0x000FFFC0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  106. #define NewTSMTEPreUpdateProc(userRoutine)                         (TSMTEPreUpdateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, GetCurrentArchitecture())
  107. #define NewTSMTEPostUpdateProc(userRoutine)                     (TSMTEPostUpdateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, GetCurrentArchitecture())
  108. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)         CALL_TWO_PARAMETER_UPP((userRoutine), uppTSMTEPreUpdateProcInfo, (textH), (refCon))
  109. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)  CALL_SEVEN_PARAMETER_UPP((userRoutine), uppTSMTEPostUpdateProcInfo, (textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  110.  
  111. #if PRAGMA_STRUCT_ALIGN
  112.     #pragma options align=reset
  113. #elif PRAGMA_STRUCT_PACKPUSH
  114.     #pragma pack(pop)
  115. #elif PRAGMA_STRUCT_PACK
  116.     #pragma pack()
  117. #endif
  118.  
  119. #ifdef PRAGMA_IMPORT_OFF
  120. #pragma import off
  121. #elif PRAGMA_IMPORT
  122. #pragma import reset
  123. #endif
  124.  
  125. #ifdef __cplusplus
  126. }
  127. #endif
  128.  
  129. #endif /* __TSMTE__ */
  130.  
  131.